var navBarMenus = $('a.nav-bar-menu');

var navBarMenuClick = function(sender) {
	sender.preventDefault();

	var menu = $(this);
	var view = 	menu.attr('data-view');

	$.post(app.baseUrl() + 'index.php/home/setView', {
		'view' : view
	}).done(function(response) {
		if (response.toString().toLowerCase() == view) window.location.replace(app.baseUrl());
	}).fail(function(response) {

	}).always(function() {

	});
};

$(document).ready(function() {
	navBarMenus.unbind('click');
	navBarMenus.click(navBarMenuClick);
});